package com.ljy.tkmodel.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.ljy.tkmodel.entity.Teacher;
import com.ljy.tkmodel.mapper.TeacherMapper;
import com.ljy.tkmodel.service.TeacherService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author testjava
 * @since 2022-03-08
 */
@Service
public class TeacherServiceImpl extends ServiceImpl<TeacherMapper, Teacher> implements TeacherService {

    @Override
    public Integer addTeacher(Teacher teacher) {
        if (!ObjectUtils.isEmpty(teacher)){
            return  baseMapper.insert(teacher);
        }
        return null;
    }

    @Override
    public List<Teacher> selectTeacher(Map map) {
        System.out.println("调用Teacher");
        if (CollectionUtil.isEmpty(map)){
            return baseMapper.selectList(null);
        }else {
            //todo 条件查询teacher
            return  null;
        }
    }
}
